﻿package ascript.components.level
{
	//#########################
	// Header Includes
	//#########################
	import ascript.Game;
	import ascript.utilities.PointSimple;
	import ascript.GameComponent;
	import ascript.GameLevel;
	import ascript.GameObject;
	import Box2D.Common.Math.b2Vec2;
	
	//#########################
	// GeneralModifiers Class
	//#########################
	public class LevelPickupAnimated extends GameComponent
	{
		//=========================
		// Constructors
		//=========================	
		public function LevelPickupAnimated():void
		{
		}
		
		//=========================
		// Members
		//=========================		
		override public function applyAttribute( tGame:Game, tObject:GameObject, tAttribute:String ):void
		{
			switch( tAttribute )
			{
				case "CollisionIsEnabled":
					if ( !tObject.getAttribute( tAttribute ) )
					{
						tObject.setAttribute( "AnimationDeathIsEnabled", true );
					}
					break;
				case "AnimationDeathIsComplete":
					if ( tObject.getAttribute( tAttribute ) )
					{
						tObject.setAttribute( "IsDeleted", true );
					}
					break;
				default:
					super.applyAttribute( tGame, tObject, tAttribute );
					break;
			}
		}
	}
}